package com.ffapp.demo.bean;

import android.content.Context;
import android.text.TextUtils;

import com.amap.api.maps.model.LatLng;
import com.ffapp.demo.R;

public class DeviceListData extends BasisBean {

//    {
//        "result": [
//        {
//            "point": "118.09726,24.57129",
//                "number": "0055667788",
//                "status": 0,
//                "name": "兆章测试",
//                "type": 1,
//                "icon": "http://218.85.131.36:7211/public/admin/images/device_default_offline.png",
//                "areaId": 10,
//                "address": "厦门市尚南路25集美欣盛经济发展公司"
//        },
//        {
//            "point": "118.00531,24.60742",
//                "number": "1222222222",
//                "status": 1,
//                "name": "12312",
//                "type": 1,
//                "icon": "http://218.85.131.36:7211/public/admin/images/device_default_online.png",
//                "areaId": 9,
//                "address": "福建省厦门市集美区"
//        },
//    }


    private String point;
    private String number;
    private String status;
    private String name;
    private int type;
    private String icon;
    private int areaId;
    private String address;

    public DeviceListData() {
        super();
    }
    public DeviceListData(String name,String address) {
        super();
        this.name = name;
        this.address = address;
    }



    public String getPoint() {
        return point;
    }

    public void setPoint(String point) {
        this.point = point;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public int getAreaId() {
        return areaId;
    }

    public void setAreaId(int areaId) {
        this.areaId = areaId;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }



    public int getMapMarkerResid(Context mContext) {
            return  R.mipmap.map_coordinate_b;
    }


//    public View getMarkerView(Context context) {
//        View view = View.inflate(context, R.layout.base_marker_view, null);
//        TextView tvName = (TextView) view.findViewById(R.id.text_name);
//        TextView tvLength = (TextView) view.findViewById(R.id.text_length);
//        ImageView imgIcon = (ImageView) view.findViewById(R.id.img_icon);
//        tvName.setText(name);
//        switch (getLengthToMarkerView()) {
//            case "0":
//                tvLength.setVisibility(View.GONE);
//                break;
//            default:
//                tvLength.setVisibility(View.VISIBLE);
//                tvLength.setText(getLengthToMarkerView());
//                break;
//        }
//
//        imgIcon.setBackgroundResource(getMapMarkerResid(context));
//        return view;
//    }


    public LatLng getLatlng() {
        String[] xyPoint = point.split(",");
        if (TextUtils.isEmpty(point) || xyPoint.length<2) {
            return new LatLng(0, 0);
        }

        LatLng latLng = new LatLng(Double.valueOf(xyPoint[1]), Double.valueOf(xyPoint[0]));
        return latLng;
    }

    public DeviceListData(String name,int value) {
        super();
        this.name = name;
        this.value = value;
    }


    private int value;

    private String offStateCount;   //离线
    private String onStateCount;       //在线
    private String hotStandbyCount;     //设备
    private String runCount;                //运行中

    public String getOffStateCount() {
        return offStateCount;
    }

    public void setOffStateCount(String offStateCount) {
        this.offStateCount = offStateCount;
    }

    public String getOnStateCount() {
        return onStateCount;
    }

    public void setOnStateCount(String onStateCount) {
        this.onStateCount = onStateCount;
    }

    public String getHotStandbyCount() {
        return hotStandbyCount;
    }

    public void setHotStandbyCount(String hotStandbyCount) {
        this.hotStandbyCount = hotStandbyCount;
    }

    public String getRunCount() {
        return runCount;
    }

    public void setRunCount(String runCount) {
        this.runCount = runCount;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

}
